#!/bin/sh
#author is hanjieLin
#this sh script should be added into latestat.sh as service on boot.
#It record double adb log and kernel log automatically as file located /data.
#When system crash on boot , we could not fetch log at the moment, but after
#power recycle we could get the last crash log.

if [ -e "/data/log_flag" ];then
	rm /data/log_flag
	logcat -v time > /data/logcat_log &
	cat /proc/kmsg > /data/kmsg_log &
else
  	rm /data/log_flag
	logcat -v time > /data/logcat_log2 &
	cat /proc/kmsg > /data/kmsg_log2 &
fi